import instance from "@/utils/request";

// 省去了return+{}
export const doRegister = (data)=>instance.post("/api/user/reg",data);
export const doCheckphone = (data)=>instance.post("/api/user/docheckphone",data);
export const doSendmsgcode = (data)=>instance.post("/api/user/dosendmsgcode",data);
export const doCheckcode = (data)=>instance.post("/api/user/docheckcode",data);
export const doLogin = (data)=>instance.post("/api/user/login",data);

// 检测手机号是否被注册过
export function doCheckPhone (params) {
  return instance.post('/api/user/docheckphone', params)
}

// 发送短信验证码
export function doSendMsgCode (params) {
  return instance.post('/api/user/dosendmsgcode', params)
}

// 验证验证码
export function doCheckCode (params) {
  return instance.post('/api/user/docheckcode', params)
}

// 设置密码完成注册
export function doFinishRegister (params) {
  return instance.post('/api/user/dofinishregister', params)
}


// 获取用户信息
export function getUserInfo (params) {
  return instance.get('/api/user/info', { params })
}

// 更新用户名
export function updateUsername (params) {
  return instance.get('/api/user/bindusername', {params})
}

// 更新密码
export function updatePassword (params) {
  return instance.get('/api/user/updatePassword', {params})
}